export const TOKEN_KEY = 'TOKEN__';
export const USER_INFO_KEY = 'USER__INFO__';

//获取token
export function getToken() {
  return JSON.parse(localStorage.getItem(TOKEN_KEY))
}

//清除token
export function removeToken() {
  return localStorage.removeItem(TOKEN_KEY)
}

//设置token 
export function setAuthCache(key, value) {
  return localStorage.setItem(key, JSON.stringify(value))
}

export function getAuthCache(key) {
  return JSON.parse(localStorage.getItem(key))
}

//清除本地
export function clearCache() {
  return localStorage.clear()
}